import 'package:flutter/material.dart';
import 'package:hotfil_pub_web/routes/app_pages.dart';
import 'package:hotfil_pub_web/widgets/IconFontIcons.dart';
import 'package:hotfil_pub_web/widgets/my_theme.dart';
import 'package:hotfil_pub_web/widgets/options_base.dart';
import 'package:get/get.dart';

class MineOptionItem extends StatelessWidget {
  final IconData iconData;
  final String optionText;
  final void Function() handle;

  const MineOptionItem(this.iconData, this.optionText, this.handle, {Key? key})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return OptionsItemBase(
      handle: handle,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Icon(
            iconData,
            size: 24,
          ),
          SizedBox(
            width: 15,
          ),
          Expanded(
            child: Text(
              optionText,
              style: TextStyle(fontSize: 14, color: MyTheme.mainTextColor),
            ),
          ),
          Icon(
            Icons.arrow_forward_ios,
            size: 16,
            color: MyTheme.secondaryIconColor,
          )
        ],
      ),
    );
  }
}

class MineOptions extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return OptionsBase(children: [
      MineOptionItem(IconFontIcons.iconTuichudenglu, '退出登录', () {}),
      MineOptionItem(IconFontIcons.iconDuoyuyan, '多语言/Language', () {
        Get.toNamed(Routes.LANG_SELECT);
      }),
    ]);
  }
}
